package com.meng.controller;

import com.meng.cloud.service.HelloRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;


/**
 *测试 消费远程服务的控制层
 *
 * @author MENG
 * @version 2018/1/3
 * @see
 */
@RestController
public class ConsumerController
{

    @Autowired
    private HelloRemote helloRemote;

    @RequestMapping("sayHello")
    private ModelAndView sayHello(String name)
    {
        Map<String,Object> result = new HashMap<>(2);

        String str = helloRemote.sayHello(name);

        result.put("str",str);

        return new ModelAndView("/hello", result);
    }


}
